<template>
  <div class="dashboard-editor-container">
    <div class=" clearfix">
      <pan-thumb :image="avatar" style="float: left">
        角色：
        <span v-for="item in roles" :key="item" class="pan-info-roles">{{ item }}</span>
      </pan-thumb>
      <!-- <github-corner style="position: absolute; top: 0px; border: 0; right: 0;" /> -->
      <div class="info-container">
        <span class="display_name">{{ name }}</span>
        <!-- <span style="font-size:20px;padding-top:20px;display:inline-block;">Editor's Dashboard</span> -->
      </div>
    </div>
    <div>
      <div class="wl-about__row">
        <div class="wl-about__name">walle 版本</div> <span class="wl-about__desc">{{ version }}</span>
      </div>
      <div class="wl-about__row">
        <div class="wl-about__name">服务器信息</div> <span class="wl-about__desc">{{ server }}</span>
      </div>
      <div class="wl-about__row">
        <div class="wl-about__name">Python</div> <span class="wl-about__desc">{{ python }}</span>
      </div>
      <!-- <img :src="emptyGif" class="emptyGif"> -->
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import PanThumb from '@/components/PanThumb'
import GithubCorner from '@/components/GithubCorner'
import { getSystemInfo } from '@/api/user'

export default {
  name: 'DashboardEditor',
  components: { PanThumb, GithubCorner },
  data() {
    return {
      // emptyGif: 'https://wpimg.wallstcn.com/0e03b7da-db9e-4819-ba10-9016ddfdaed3'
      python: '',
      server: '',
      version: ''
    }
  },
  computed: {
    ...mapGetters([
      'name',
      'avatar',
      'roles'
    ])
  },
  mounted: function () {
    getSystemInfo().then(response => {
      const { code, data, message } = response.data
      if (code !== 0) {
        console.log(message)
        return
      }
      this.python = data.python
      this.server = data.server
      this.version = data.version
    }).catch(error => {
      console.log(error)
    })
  }
}
</script>

<style lang="scss" scoped>
  .emptyGif {
    display: block;
    width: 45%;
    margin: 0 auto;
  }

  .dashboard-editor-container {
    // background-color: #e3e3e3;
    background: url('~@/assets/welcom.jpg') no-repeat fixed center;
    background-size: cover;
    height: calc(100vh - 50px);
    padding: 50px 60px 0px;
    .pan-info-roles {
      font-size: 12px;
      font-weight: 700;
      color: #333;
      display: block;
    }
    .info-container {
      position: relative;
      margin-left: 150px;
      height: 150px;
      line-height: 200px;
      .display_name {
        font-size: 48px;
        line-height: 48px;
        color: #212121;
        position: absolute;
        top: 25px;
      }
    }
  }
  .wl-about__row {
    display: -ms-flexbox;
    display: flex;
    color: #606266;
    padding: 5px 0;
    font-size: 14px;
    // -ms-flex-pack: center;
    // justify-content: center;
  }
  .wl-about__name {
    width: 100px;
    color: #999;
    font-size: 16px;
    margin-right: 20px;
    text-align: right;
  }
  .wl-about__desc {
    font-size: 14px;
    line-height: 16px;
    // width: 350px;
  }
</style>
